<?php 
include("header.tpl.php");
?>
<body onload="loadCom()">
<style>
.fixed {  
	width:150px;
	position: fixed !important;  
	position: absolute;  
	top: 220px;
	right: 0px;
	display: block;
}  
</style>
<script type="text/javascript" src="./js/com.js?v=1"></script>
<script type="text/javascript" src="./js/jquery.js"></script>
<div id="comDiv" style="display:none;" class="fixed">asdfasdf</div>
<form id="search" name="condition" action="search.php" method="get">
<input type="hidden" name="p" />
<input type="text" accesskey="s" name="q" id="q" value="<?php echo $keyWord;?>" />
<select name="catID">
	<option value="0">所有类目</option>
<?php 
	$nowCat = "所有类目";
	foreach ($cats as $cat)
	{
		if($cat['cid'] == $seaCat)
		{
			$isSelect = " selected ";
			$nowCat = $cat['name'];
		}else
		{
			$isSelect='';
		}
		echo "<option value='".$cat['cid']."'".$isSelect.">".$cat['name']."</option>\n";
	}
	
?>
</select>
<select name="areaID">
	<option value=''>所有地区</option>
<?php 
	$nowProvince = "所有地区";
	foreach ($provinces as $province)
	{
		if($province['area_id'] == $seaAreaId)
		{
			$isSelect = " selected ";
			$nowProvince = $province['area_name'];
		}else
		{
			$isSelect='';
		}
		echo "<option value='".$province['area_id']."'".$isSelect.">".$province['area_name']."</option>\n";
	}
	
?>
</select>
<input type="submit" value='搜索' />
</form>
<table border=0 cellpadding="0" cellspacing="1" bgcolor="blue">
<tr>
<td colspan="6" bgcolor="#FFFFFF">
当前 <?php echo $nowCat;?>  类目下共<?php echo $seaNum?$seaNum:"0";?>个商品
</td>
<tr>
<td colspan="6" bgcolor="#FFFFFF">
<?php
if (count($catResult)>0)
{
	include(dirname(__FILE__)."/../inc/allCats.php");
	$allCats = unserialize($allCatsStr);
	foreach($catResult as $catItem)
	{
		echo "<a href='./search.php?q=".$keyWord."&catID=".$catItem['category_id']."'>".$allCats[$catItem['category_id']]['name']."</a>(".$catItem['count'].") ";
	}
}

?>
</td>
</tr>
<?php 
//print_r($items);
if(count($items)>0)
{
	foreach ($items as $item)
	{
		echo "<tr bgcolor='#FFFFFF'>";
		echo "<td><a href='./item.php?iid=".$item['iid']."&n=".urlencode($item['nick'])."' target='_blank'><img src='".$item['pic_path']."_sum.jpg' border=0></a></td>";
		echo "<td><a href='./item.php?iid=".$item['iid']."&n=".urlencode($item['nick'])."' target='_blank'>".$item['title']."</a>";
		echo "<br>卖家:<a href='./goShop.php?nick=".urlencode($item['nick'])."'>".$item['nick']."</a> <a target='_blank' href='http://amos1.taobao.com/msg.ww?v=2&uid=".urlencode($item['nick'])."&s=1'>";
		echo "<img border='0' src='http://amos1.taobao.com/online.ww?v=2&uid=".urlencode($item['nick'])."&s=1' alt='联系卖家' /></a></td>";
		echo "<td>".$item['price']."</td>";
		echo "<td>".$item['post_fee']."</td>";
		echo "<td>".($item['type']=="fixed"?"一口价":"拍卖")."</td>";
		echo "<td><input type='button' value='对比' onclick='addCom(\"".$item['iid']."\",\"".$item['title']."\",\"".$item['nick']."\")'/></td>";
		echo "</tr>\n";
	}
}
?>
</table>
<table>
<tr>
<td><?php echo $pageStr;?></td>
</tr>
</table>
</body>
<?php 
include("footer.tpl.php");
?>